#include <stdio.h>
#include <unistd.h>
#include "cmsis_os2.h"
#include "common_def.h"
#include "errno.h"
#include "pwm.h"

#define IOT_PWM_MIN_DUTY           0
#define IOT_PWM_MAX_DUTY           100
#define IOT_PWM_DUTY_PART          10
#define IOT_PWM_FREQ_PART          2
#define IOT_PWM_MAX_DIV_NUM_MAX    8
#define IOT_PWM_CFG_OFFEST_TIME    0
#define IOT_PWM_CFG_REPEAT_CYCLE   0
#define IOT_PWM_CFG_REPEAT_STATE   true
#define Frequency 1230   //pwm接口不能输出低于1230hz的pwm,只能通过IO模拟的方式输出
#define IOT_SUCCESS 0
#define IOT_FAILURE (-1)

unsigned int IoTPwmInit(unsigned int port);
unsigned int IoTPwmDeinit(unsigned int port);
unsigned int IoTPwmStart(uint8_t port, unsigned short duty, unsigned int freq);
unsigned int IoTPwmStop(unsigned int port);